// 跳转页面


/**
 * 跳转到login页面
 * @param hasLogin 是否登录
 * @param oraUrlPage 回跳地址
 * @param redirectType 跳转类型 navigateTo| switchTab
 */
export function redirectLoginPage(hasLogin, oraUrlPage, redirectType) {
    if (hasLogin === false) {
        uni.showToast({
            icon: 'none',
            duration: 5000,
            title: `您还没有登录，请先登录！`,
            complete: function (res) {
                setTimeout(() => {
                    var url = '/pages/user/index?oraUrlPage=' + oraUrlPage + '&redirectType=' + redirectType;
                    switchTabPage(url)
                },2000)
            }
        });
       
        // uni.navigateTo({url: '/pages/user/index?oraUrlPage='+ oraUrlPage+'&redirectType='+ redirectType})
        return
    }
}


/**
 * navigateToPage
 * @param url
 */
export function redirectToPage(url) {
    uni.redirectTo({url: url})
}


/**
 * navigateToPage
 * @param url
 */
export function navigateToPage(url) {
    uni.navigateTo({url: url})
}

export function switchTabPage(url) {
    uni.switchTab({
        url: url
    });
}